/**
 * 加载js文件
 * @param url 文件地址
 * @param callback 回调
 */
function loadScript(url, callback) {
    const script = document.createElement("script");
    script.type = "text/javascript";
    if (callback) {
        if (script.readyState) {  // IE
            script.onreadystatechange = function () {
                if (script.readyState === "loaded" || script.readyState === "complete") {
                    script.onreadystatechange = null;
                    callback();
                }
            };
        } else {  // Others
            script.onload = function () {
                callback();
            };
        }
    }
    script.src = url;
    document.getElementsByTagName("head")[0].appendChild(script);
}

class Global {

    start(fun) {
        fun && fun(this);
    }
}

const global = new Global();
